package com.dao.impl;

import com.dao.TableDataDao;
import com.models.TableData;
import com.persistence.DataPersistence;

/**
 * Created by TimeLiar on 2015/10/12.
 * Speed
 */
public class TableDataDaoImpl implements TableDataDao {
    @Override
    public void addDate(TableData... tableData) {
        DataPersistence.persistence(tableData);
    }

    @Override
    public void deleteDate(String tableName) {
        try {
            DataPersistence.delete(tableName);
        } catch (com.util.Error error) {
            System.out.println(error.getMessage());
        }
    }

    @Override
    public void updateDate(TableData tableData) {
        DataPersistence.persistence(tableData);
    }

    @Override
    public TableData getDate(String tableName) {
        return DataPersistence.getData(tableName);
    }
}
